<extend name="Console:index"/>
<block name="main">
    <div>
        <ol class="breadcrumb">
            <li class="active"><a href="{:U('User/index')}">用户管理</a></li>
           <empty name="userData" >
               <li class="active">用户添加</li>
               <else/>
               <li class="active">用户修改</li>
           </empty>

        </ol>
    </div>
    <div class="row">
        <div class="col-md-offset-4 col-md-4">
            <form class="form-horizontal" method="post"
                <empty name="userData" >
                    action="{:U('User/insertUser')}"
                    <else/>
                    action="{:U('User/saveUser')}"
                </empty>>

                <input name="uid" type="hidden" value="{$userData.uid}"/>

                <div id="legend" class="">

                    <empty name="userData" >
                        <legend class="">用户添加</legend>
                        <else/>
                        <legend class="">用户修改</legend>
                    </empty>
                </div>

            <empty name="userData">

                <div class="form-group">
                    <label class="col-md-4 control-label" for="input01">用户帐号</label>
                    <div class="col-md-8">
                        <input placeholder="请输入用户账号" class="form-control" type="text" id="input01" name="username" value="{$userData.username}" required>
                        <p class="help-block"></p>
                    </div>
                </div>

            </empty>


                <div class="form-group">
                    <label class="col-md-4 control-label" for="input011">用户昵称</label>
                    <div class="col-md-8">
                        <input placeholder="请输入用户昵称" class="form-control" type="text" id="input011" name="name"  value="{$userData.name}" required >
                        <p class="help-block"></p>
                    </div>
                </div>

            <empty name="userData">
                <div class="form-group">
                    <label class="col-md-4 control-label" for="input012">密码</label>
                    <div class="col-md-8">
                        <input placeholder="请输入密码" class="form-control" type="password" id="input012" name="paw"   required>
                        <p class="help-block"></p>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-4 control-label" for="input013">再次密码</label>
                    <div class="col-md-8">
                        <input placeholder="请输入再次输入密码" class="form-control" type="password" id="input013" name="repaw" required >
                        <p class="help-block"></p>
                    </div>
                </div>

            </empty>

                <div class="form-group">
                    <label class="col-md-4 control-label" for="input02">用户描述</label>
                    <div class="col-md-8">
                        <input placeholder="请输入用户描述" class="form-control" type="text" id="input02" name="remark" required value="{$userData.remark}" >
                        <p class="help-block"></p>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-4 control-label">用户角色</label>
                    <div class="col-md-8">
                        <select class="form-control" name="role" required >
                            <volist name="roleList" id="rl">
                                <option  value="{$rl.id}" <eq name="userData.role_id" value="$rl.id">selected</eq> > {$rl.name}</option>

                            </volist>

                        </select>
                    </div>

                </div>

                <div class="form-group">
                   <label class="col-md-4 control-label">是否开启</label>
                    <div class="col-md-8">
                        <label class="radio-inline">
                            <input  value="0" type="radio" name="status" <notempty name="userData.ustatus"> <eq name="userData.ustatus" value="0">checked="checked"</eq> </notempty>  >禁用
                        </label>
                        <label class="radio-inline">
                            <input value="1" type="radio" name="status"   <notempty name="userData.ustatus"> <eq name="userData.ustatus" value="1">checked="checked"</eq> <else/> checked="checked"</notempty>        >开启
                        </label>
                    </div>
                </div>

                <div class="form-group">
                    <button class="btn btn-success col-md-offset-9" id="btn">提交</button>
                </div>

            </form>
        </div>
    </div>
    <script>

    </script>

</block>